package com.taxshare.seller.controller;

import com.taxshare.mybatis.pager.PageRequest;
import com.taxshare.response.beans.Response;
import com.taxshare.seller.entity.SellerDetialMergeEntity;
import com.taxshare.seller.service.SellerDetialMergeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: SellerDetialController
 * @Description:
 * @author: Hai
 * @date: 2021/7/12 9:55
 */
@Slf4j
@RestController
@RequestMapping("/sellerDetial")
@Api(tags="地产明细合并规则")
public class SellerDetialController {

    @Autowired
    private SellerDetialMergeService sellerDetialMergeService;

    @PostMapping("/getSellerDetialMergeList")
    @ApiOperation(value = "分页查询", notes = "地产明细合并规则")
    public Response getSellerDetialMergeList(@RequestBody PageRequest<SellerDetialMergeEntity> query) {
        return sellerDetialMergeService.getSellerDetialMergeList(query);
    }

    @PostMapping("/addSellerDetialMerge")
    @ApiOperation(value = "新增", notes = "地产明细合并规则")
    public Response addSellerDetialMerge(@RequestBody SellerDetialMergeEntity entity) {
        return sellerDetialMergeService.addSellerDetialMerge(entity);
    }

    @PostMapping("/updateSellerDetialMerge")
    @ApiOperation(value = "修改", notes = "地产明细合并规则")
    public Response updateSellerDetialMerge(@RequestBody SellerDetialMergeEntity entity) {
        return sellerDetialMergeService.updateSellerDetialMerge(entity);
    }

    @PostMapping("/delSellerSplitTemplate")
    @ApiOperation(value = "删除", notes = "地产明细合并规则")
    public Response delSellerDetialMerge(@RequestParam String uuid) {
        return sellerDetialMergeService.delSellerDetialMerge(uuid);
    }
}
